<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function fun() {
            for (var i = 100; i <= 999; i++) {
                var sum1 = 0
                var i_string = String(i)
                for (var j = 0; j <= 2; j++) {
                    var sum2 = 1
                    var chai = i_string.charAt(j)
                    var num = Number(chai)
                    if (num > 0) {
                        for (var k = num; k > 0; k--) {
                            sum2 *= k
                        }
                    } else {
                        sum2 = 0
                    }
                    sum1 += sum2
                }
                if (sum1 == i) {
                    console.log(i + "是喇叭花数");
                }
            }
        }

        fun()
    </script>
</head>

<body>

</body>

</html>